home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-04-08 | 3.5 KB | 80 lines | [TEXT/MPS ] |
- ////////////////////////////////////////////////////////////////////////////////
- // OPEN SCRIPTING ARCHITECTURE: Generic Component Interface
- ////////////////////////////////////////////////////////////////////////////////
- // Copyright © 1992 Apple Computer, Inc. All rights reserved.
- // Authors: Jens Alfke, William Cook, Donn Denman, and Warren Harris
- ////////////////////////////////////////////////////////////////////////////////
- // This interface defines a "generic scripting component."
- // The Generic Scripting Component allows automatic dispatch to a
- // specific scripting component that conforms to the OSA interface.
- // This component supports OSA, by calling AppleScript or some other
- // scripting component. Additionally it provides access to the default
- // and the user-prefered scripting component.
- ////////////////////////////////////////////////////////////////////////////////
-
- #ifndef __OSAGeneric__
- #define __OSAGeneric__
-
- #ifndef __OSA__
- #include "OSA.h"
- #endif
-
- #define errOSAComponentMismatch -1761 // Parameters are from 2 different components
- #define errOSACantOpenComponent -1762 // Can't connect to scripting system with that ID
-
- #define kGenericComponentVersion 0x0100 // Component version this header file describes
-
- #define kGSSSelectGetDefaultScriptingComponent 0x1001 // == kOSASelectComponentSpecificStart
- #define kGSSSelectSetDefaultScriptingComponent 0x1002
- #define kGSSSelectGetScriptingComponent 0x1003
- #define kGSSSelectGetScriptingComponentFromStored 0x1004
- #define kGSSSelectGenericToRealID 0x1005
- #define kGSSSelectRealToGenericID 0x1006
- #define kGSSSelectOutOfRange 0x1007
-
- typedef OSType ScriptingComponentSelector;
- typedef OSAID GenericID;
-
- // get and set the default scripting component
- pascal OSAError
- OSAGetDefaultScriptingComponent( ComponentInstance genericScriptingComponent,
- ScriptingComponentSelector* scriptingSubType) // out
- = ComponentCallNow(kGSSSelectGetDefaultScriptingComponent, 4);
-
- pascal OSAError
- OSASetDefaultScriptingComponent( ComponentInstance genericScriptingComponent,
- ScriptingComponentSelector scriptingSubType ) // in
- = ComponentCallNow(kGSSSelectSetDefaultScriptingComponent, 4);
-
- // get a scripting component instance from its subtype code
- pascal OSAError
- OSAGetScriptingComponent( ComponentInstance genericScriptingComponent,
- ScriptingComponentSelector scriptingSubType, // in
- ComponentInstance* scriptingInstance ) // out
- = ComponentCallNow(kGSSSelectGetScriptingComponent, 8);
-
- // get a scripting component selector (subType) from a stored script
- pascal OSAError
- OSAGetScriptingComponentFromStored( ComponentInstance genericScriptingComponent,
- const AEDesc *scriptData, // in
- ScriptingComponentSelector* scriptingSubType ) // out
- = ComponentCallNow(kGSSSelectGetScriptingComponentFromStored, 8);
-
- // get a real component instance and script id from a generic id
- pascal OSAError
- OSAGenericToRealID( ComponentInstance genericScriptingComponent,
- OSAID *theScriptID, // in/out
- ComponentInstance *theExactComponent ) // out
- = ComponentCallNow(kGSSSelectGenericToRealID, 8);
-
- // get a generic id from a real component instance and script id
- pascal OSAError
- OSARealToGenericID( ComponentInstance genericScriptingComponent,
- OSAID *theScriptID, // in/out
- ComponentInstance theExactComponent ) // in
- = ComponentCallNow(kGSSSelectRealToGenericID, 8);
-
- #endif // ifdef __OSAGeneric__
- //////////////////////////////////////////////////////////////////////////////////////////////////////
-
-